<template>
	<view>
		<view>
			<view style="position: relative;width: 100%;height: 300rpx;background-color: #E7551C;">
				<view style="position: absolute;z-index: 999;
				background-color: rgba(0, 0, 0, 0.1);width: 100%;height: 100%;
				display: flex;
				justify-content: center;
				flex-direction:column;
				padding-left: 50rpx;
				">
					<view style="width: 132rpx;height: 132rpx;border-radius: 100%;
					background-color: #fff;
					display: flex;
					justify-content: center;
					align-items: center;">
						<image
						style="width: 120rpx;height: 120rpx;border-radius: 100%;"
						:src="designer.avatar"></image>
					</view>
					<view style="color: #fff;display: block;margin-top: 10rpx;font-size: 14px;
					padding-left: 30rpx;display: flex;">
						{{designer.user_name}}
						<i class="iconfont icon-nan" style="margin-left: 5rpx;color: #fff;"></i>
					</view>
				</view>
				<view style="position: absolute;z-index: 999;
				background-color: rgba(0, 0, 0, 0.1);width: 100%;height: 100%;
				display: flex;
				justify-content: center;
				flex-direction:column;
				padding-left: 350rpx;color: #fff;">
					<view style="display: flex;">
						<view style="display: flex;width: 120rpx;
						justify-content: center;border-right: 1px solid #fff;
						flex-direction:column;align-items: center;text-align: center;">
							<i class="iconfont icon-xunzhang" 
							style="margin-left: 10rpx;color: #fff;font-size: 16px;"></i>
							<view>
								勋章
							</view>
						</view>
						<view style="display: flex;width: 120rpx;
						justify-content: center;border-right: 1px solid #fff;
						flex-direction:column;align-items: center;text-align: center;">
							<text>68</text>
							<view>
								项目数
							</view>
						</view>
						<view style="display: flex;width: 120rpx;
						justify-content: center;
						flex-direction:column;align-items: center;text-align: center;">
							<text>68</text>
							<view>
								收藏
							</view>
						</view>
					</view>
					<view style="margin-top: 80rpx;width: 360rpx;
					height: 60rpx;
					line-height: 60rpx;
					text-align: center;
					border-radius: 20px;
					background-color: #fff;color: #666;"
					@click="updateInfo">编辑资料</view>
				</view>
			</view>
		</view>
		<view class="u-p-l-20 u-p-r-20 u-p-t-20" style="background-color: #fff;padding-bottom: 120rpx;">
			<view style="padding-bottom: 10rpx;">
				简介：
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				年龄：30岁
				&nbsp;&nbsp;&nbsp;&nbsp;
				籍贯：武汉
			</view>
			<view style="padding-bottom: 10rpx;">
				毕业院校：中南财经政法大学
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				专业：平面设计
			</view>
			<view style="padding-bottom: 10rpx;">
				工作经历：
				<view>
					2012年-2014年 一起装修网 设计助理
				</view>
				<view>
					2014年-2016年 一起装修网 设计师
				</view>
				<view>
					2016年-至今 真会装 砖石设计师
				</view>
			</view>
			<view style="padding-bottom: 10rpx;">
				自我评价：
				{{designer.user_intro}}
			</view>
			<view class="demo-warter" v-for="(item, index) in flowList" :key="index">
				<view style="
				display: flex;justify-content: space-between;align-items: center;">
					<view style="display: flex;">
						<image
						style="width: 80rpx;height: 80rpx;border-radius: 100%;
						position: relative;"
						:src="item.avatar"></image>
						<view>
							<view style="width: 100rpx;text-align: center;color:#999">{{item.user_name}}</view>
							<text style="width: 100rpx;text-align: center;color:#999;
							padding-left: 10rpx;font-size: 12px;">2022/12/03</text>
						</view>
					</view>
					<view style="display: flex;height: 50rpx;line-height: 50rpx;color: #999;">
						<text style="font-size: 13px;">有414个人收藏</text>
					</view>
				</view>
				<view style="height: 60rpx;line-height:60rpx">
					{{item.project_name}}
				</view>
				<view style="margin-top: 10rpx;">
					<image :src="item.project_cover_img" style="width: 220rpx;height: 220rpx;border-radius: 8rpx;margin-right: 18rpx;"></image>
					<image :src="item.project_cover_img" style="width: 220rpx;height: 220rpx;border-radius: 8rpx;margin-right: 18rpx;"></image>
					<image :src="item.project_cover_img" style="width: 220rpx;height: 220rpx;border-radius: 8rpx;"></image>
				</view>
			</view>
		</view>
		<view class="bottom-btn">
			<u-button @click="yuyue" :custom-style="customStyle">立即预约</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				houseList: [],
				flowList: [],
				designer:{
					user_name:'',
					user_intro:''
				},
				customStyle: {
					background: '#E7551C !important',
					color: '#fff !important',
					border: 'none !important'
				}
			}
		},
		onLoad(option) {
			let designerId = option.designerId //上个页面传递的参数。
			// 获取数据
			this.findHouseList(designerId);
		},
		onUnload() {
			
		},
		methods: {
			findHouseList(designerId) {
				let url = "/designer-api/v1/info/"+designerId;
				this.$u.get(url, {
					pageNumber: this.pageNum,
					pageSize: this.pageSize,
				}).then(result => {
					this.flowList = result
					this.designer = this.flowList[0]
				});
			},
			clickImage(item){
				this.$u.route({
					url: '/pages/product/product',
					params: {
						productId: item.projectId
					}
				})
			},
			updateInfo(){
				this.$mytip.toast('暂未开放')
			},
			yuyue(){
				uni.switchTab({
					url: '/pages/yuyue/yuyue'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.rowClass{
		background-color: rgb(255, 255, 255);
	}
	
	.hoverClass{
		background-color: #E4E7ED;
	}
	
	.tabName{
		font-size: 14px;
		color: $u-tips-color;
	}
	
	.demo-warter {
	    border-radius: 8px;
	    margin-top: 3px;
	    background-color: #ffffff;
	    padding: 3px;
	    position: relative;
	}
	
	.item-title {
	    font-size: 28rpx;
	    color: $u-main-color;
	    font-weight: bold;
		padding-top: 15rpx;
		padding-left: 3rpx;
	}
	
	.item-desc {
	    font-size: 26rpx;
	    color: $u-tips-color;
		height: 60rpx;line-height: 50rpx;
	}
	
	.bottom-btn {
		position: fixed;
		bottom: 8rpx;
		width: 100%;
		padding: 10rpx;
		border-top: 1rpx solid #eee;
		background-color: #FFFFFF;
	}
</style>
